﻿using System.Collections.Generic;

namespace Red.Launcher.ViewModels.Workspaces.Database
{
    public class GroupStabilityWeight : Record
    {
        #region Inherited Properties

        public override Metadata Metadata => METADATA;
        public override string Icon => null;
        public override IEnumerable<object> Values => new List<object>() { Weight };

        #endregion Inherited Properties

        #region Public Properties

        public static Metadata METADATA { get; private set; }

        public double Weight { get; set; }

        #endregion Public Properties

        #region C-Tor

        static GroupStabilityWeight()
        {
            METADATA = new Metadata()
            {
                Table = @"GroupStabilityWeights",
                Keys = new List<string>() { "weight" },
                CreateDefault = () => new GroupStabilityWeight(),
                CreateFromDatabaseRow = ( Dictionary<string, object> data ) =>
                {
                    return new GroupStabilityWeight()
                    {
                        Id = (int)data[ "id" ],
                        Weight = (double)data[ "weight" ]
                    };
                },
                GenerateSelectSql = ( Record parent ) => null
            };
        }

        #endregion C-Tor
    }
}
